home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / RAND / UNSPLIT / text0849.txt < prev    next >
Encoding:
Text File  |  1997-02-06  |  3.4 KB  |  78 lines

  1.  
  2. > >Unfortunately, there's quite a difference between bumping into walls and
  3. > >actually avoiding them in the first place. Path finding algorithms are needed
  4. > >to prevent monsters from trying to walk through walls to get to their target
  5.  
  6. > I know almost nothing about this wall collision thing and you are realy talking
  7. > about sonmething different, but it can't be that hard can it? :-)
  8.  
  9. It's harder than anything else done so far - but fortunately there is very little
  10. of it so this balances things out a bit.
  11.  
  12. Anyone who thinks it is actually 'easy' can be filed under one of the following:
  13.  
  14. 1) Has not investigated it properly yet.
  15. 2) Has already aquired the code from somewhere without needing to think about it.
  16. 3) Understands the maths, but doesn't have to write the code at the end of the day.
  17.  
  18. Nuff said. :)
  19.  
  20. > I mean, you know how the map look as I can enter 'map mode' and I can see
  21. > all the walls and where the player is. Why not just see if I'm about to cross 
  22. > a wall on a 'invisible map' and if I'm, stop the player??
  23.  
  24. But your brain is a neural associator. It's good at looking at things and knowing
  25. automatically what is likely to happen and where. Computers are stupid. They need
  26. nice friendly rules. If a monster needs to navigate through a u-shaped room, it
  27. needs to 'know' where the walls are before it makes a move, otherwise it tries to
  28. take a shortcut - through a wall, or something just as equally stupid.
  29.  
  30. In order to know where the walls are, you need to check the nearest few against
  31. the player on a regular basis - or at the very least, during every decision made
  32. by the object. This is part of the AI. If this is not used, monsters will walk
  33. up to walls they cannot expect to be able to pass through and just stop there,
  34. confused and incapable of action. They may even get completely stuck if the
  35. collision system relies on yes/no tests instead of vector-magnitude 'predictions'
  36. which are essential for reliable 3D interactions.
  37.  
  38. The most effective method by far is a simple networking algorithm backed up by some
  39. scattered 'nodes' which are like meeting points at the centre of each sector.
  40. Monsters will try to navigate from one meeting point to another, ignoring the
  41. walls completely. The meeting points are not strict, but act as guides for the
  42. monsters to 'show' them where they should be walking to avoid embarrasment. They
  43. may sometimes bump into a doorway, pillar or wall - but no more often than the
  44. average player.
  45.  
  46. I'm sure Quake uses something along these lines, but even it ends up with monsters
  47. stuck in doorways and other sillyness. It's quite a serious problem really.
  48.  
  49. > You would also need to look at the height of the next sector and if the wall
  50. > is walk through able, but that can't be very hard either.
  51.  
  52. The height test is easy - but that's not the problem.
  53.  
  54. > Well, it looks like I have made a antighost routine in 30 secondes! :-))
  55.  
  56. If only. :)
  57.  
  58. > Hmm.. I'm probably talking noncense. :-)
  59.  
  60. :)
  61.  
  62. > Sounds good enough to me. If they are realy stupied I might even manage to
  63. > get trough a level! :-)
  64.  
  65. The real trick is not actually to make them 'clever' - that just gets really
  66. annoying. What you want is enemies that aren't so stupid they manage to get
  67. themselves trapped or killed for no reason other than they don't know any
  68. better. Lots of games suffer from this and it looks pathetic during play.
  69.  
  70. Games with enemies that are too clever tend to be too difficult. After all,
  71. there are hundreds of them and only one of you - the odds have to be even.
  72.  
  73. :)
  74.  
  75. Doug.
  76.  
  77.  
  78.